# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>

pkgname=gn
pkgver=0.1468.106b8238
_commit=106b823805adcc043b2bfe5bc21d58f160a28a7b
pkgrel=1
pkgdesc="Meta-build system that generates build files for Ninja"
arch=('x86_64')
url="https://gn.googlesource.com/gn/+/master/README.md"
license=('BSD')
depends=('gcc-libs')
makedepends=('clang' 'ninja' 'python2' 'git')
source=(git+https://gn.googlesource.com/gn#commit=$_commit)
md5sums=('SKIP')

pkgver() {
  cd $pkgname
  echo 0.$(git rev-list --count initial-commit..).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname
  python2 ./build/gen.py --no-sysroot
  ninja -C out gn
}

package() {
  cd $pkgname
  install -D out/gn "$pkgdir/usr/bin/gn"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et:
